package com.phuonghoang.vnexpress;

import com.phuonghoang.adapter.PaperAdapter;
import com.phuonhoang.utils.Variables;

import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.app.ListActivity;
import android.content.Intent;

public class PaperActivity extends ListActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		/*
		 * ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
		 * android.R.layout.simple_list_item_1, Variables.PAPERS);
		 */
	/*ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
				R.layout.activity_paper,R.id.tvPaper, Variables.PAPERS);*/
		PaperAdapter paperAdapter = new PaperAdapter(this, R.id.tvPaper, R.id.ivIcon,Variables.PAPERS);
		setListAdapter(paperAdapter);
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		Intent intent = new Intent("com.phuonghoang.vnexpress.VnexpressActivity");
		intent.putExtra(Variables.PAPER, position);
		startActivity(intent);
	}

}
